From: Martin Rudalics Date: Sat, 10 Mar 2007 08:37:51 +0000 (+0000) Subject: (PC-do-completion): Bind dirlength to nil to avoid X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~1637 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=ac484c2721398175946431d3b2e8b3ce76391807;p=emacs.git (PC-do-completion): Bind dirlength to nil to avoid that buffer contents get erased during completion. --- diff --git a/lisp/complete.el b/lisp/complete.el index 104f3789403..ce5094d1aef 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -417,7 +417,10 @@ of `minibuffer-completion-table' and the minibuffer contents.") (pred minibuffer-completion-predicate) (filename (funcall PC-completion-as-file-name-predicate)) (dirname nil) ; non-nil only if a filename is being completed - (dirlength 0) + ;; The following used to be "(dirlength 0)" which caused the erasure of + ;; the entire buffer text before `point' when inserting a completion + ;; into a buffer. + dirlength (str (buffer-substring beg end)) (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) (ambig nil)